<template>
  <div>
    <BaseTable :url="url" :columns="tableColumns" primary-key="dsId"></BaseTable>
  </div>
</template>

<script>
import Service from "api/Service";
import http from "network/http";
import ApiResponse from "utils/ApiResponse";

export default {
  name: "DataSource",
  data(){
    return {
      url: `/${Service.itToolService}/toolDatasource`,
      tableColumns:[
        {
          key: 'dsName' ,
          title: "数据源名称",
          required: true,
          search: true ,
          form: true
        },
        {
          key: 'username' ,
          title: "用户名" ,
          required: true ,
          search: true ,
          form: true
        },
        {
          key: 'password' ,
          attrs:{
            type: 'password'
          },
          title: "密码" ,
          disabled: "noUpdate" ,
          table: false ,
          form: true
        },
        {
          key: 'driverClass',
          title: '驱动',
          is: "DictSelect",
          form: true ,
          attrs:{
            dictKey: 'driver-class-name' ,
            url: `/${Service.itToolService}/toolDictItem/dictList` ,
            props:{
              label: 'dictTitle' ,
              value: 'dictVal'
            }
          },
          required: true
        },
        {
          key: 'dsUrl',
          required: true ,
          title: '路径',
          form: true ,
          attrs:{
            "show-overflow-tooltip": true
          }
        },
        {
          key: 'createTime',
          title: '创建时间'
        },
        {
          type: 'action',
          title: '操作',
          buttons: [
            {
              is: "DeleteButton",
              title: "删除" ,
              attrs:{
                url: `/${Service.itToolService}/toolDictItem`,
              }
            },
            {
              is: "EditFormButton",
              title: "编辑" ,
              attrs:{
                class: 'mar-rl-10px',
                url: `/${Service.itToolService}/toolDictItem`,
              }
            }
          ]
        }
      ]
    }
  },
  methods:{
  }
}
</script>

<style scoped>

</style>